<template>
  <div
    class="notify"
    :class="{
      'is-show': IS_VISIBLE_NOTIFY,
      'is-hide': !IS_VISIBLE_NOTIFY
    }"
  >
    <div class="notify__hd">
      <span class="notify-title">消息通知</span>
      <span class="notify-read">全部已读</span>
    </div>
    <el-scrollbar
      class="notify__bd"
      :style="{ height: CLIENT_HEIGHT - 90 + 'px' }"
    >
      <div class="notify-item">
        <div class="notify-item__title">消息标题</div>
        <div class="notify-item__content">消息内容消息内容消息内容消息内容消息内容消息内容消息内容</div>
        <div class="notify-item__time">2020-12-12 10:00</div>
      </div>
      <div class="notify-item">
        <div class="notify-item__title">消息标题</div>
        <div class="notify-item__content">消息内容</div>
        <div class="notify-item__time">2020-12-12 10:00</div>
      </div>
      <div class="notify-item">
        <div class="notify-item__title">消息标题</div>
        <div class="notify-item__content">消息内容消息内容消息内容消息内容消息内容消息内容消息内容</div>
        <div class="notify-item__time">2020-12-12 10:00</div>
      </div>
      <div class="notify-item">
        <div class="notify-item__title">消息标题</div>
        <div class="notify-item__content">消息内容</div>
        <div class="notify-item__time">2020-12-12 10:00</div>
      </div>
    </el-scrollbar>
    <el-pagination
      align="center"
      small
      layout="prev, pager, next"
      :total="50"
    >
    </el-pagination>
  </div>
</template>

<script>
import { mapState } from "vuex";
export default {
  name: "Notify",
  computed: {
    ...mapState(["CLIENT_HEIGHT", "IS_VISIBLE_NOTIFY"])
  }
};
</script>

<style lang="scss" scoped>
.notify {
  position: fixed;
  top: 80px;
  right: -320px;
  bottom: 0;
  z-index: 10;
  width: 320px;
  height: 100%;
  background: #fff;
  color: #23232b;
  border-left: 1px #e6e6e6 solid;
  box-shadow: -3px 0 10px #e6e6e6;
  &__hd,
  &__bd {
    padding: 0 15px;
  }
  &__hd {
    height: 48px;
    line-height: 48px;
    border-bottom: 1px #e6e6e6 solid;
  }
  &-title {
    font-size: 16px;
    font-weight: 700;
  }
  &-read {
    float: right;
    color: #04c1fe;
    cursor: pointer;
  }
  &-item {
    &:not(:last-child) {
      border-bottom: 1px #e6e6e6 solid;
    }
    padding: 5px 0;
    &__title {
      font-size: 16px;
      line-height: 32px;
    }
    &__content {
      color: #888;
    }
    &__time {
      text-align: right;
      color: #949699;
      line-height: 28px;
    }
  }
  &.is-show {
    right: 0;
    transition: right 0.2s;
  }
  &.is-hide {
    right: -320px;
    transition: right 0.2s;
  }
}

</style>